package com.lanvideo.entity;

import java.time.LocalDateTime;

/**
 * 考试学生关联实体类
 */
public class ExamStudent {
    private Integer id;
    private Integer examId;
    private Integer studentId;
    private Integer status; // 0:未开始 1:进行中 2:已完成
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private Integer score;
    private LocalDateTime createdTime;
    
    // 关联字段
    private String studentName;
    private String examTitle;

    public ExamStudent() {}

    public ExamStudent(Integer examId, Integer studentId) {
        this.examId = examId;
        this.studentId = studentId;
        this.status = 0; // 默认未开始
    }

    // Getters and Setters
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getExamId() {
        return examId;
    }

    public void setExamId(Integer examId) {
        this.examId = examId;
    }

    public Integer getStudentId() {
        return studentId;
    }

    public void setStudentId(Integer studentId) {
        this.studentId = studentId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public String getExamTitle() {
        return examTitle;
    }

    public void setExamTitle(String examTitle) {
        this.examTitle = examTitle;
    }

    public String getStatusText() {
        switch (status) {
            case 0: return "未开始";
            case 1: return "进行中";
            case 2: return "已完成";
            default: return "未知";
        }
    }
}
